<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="1.0" encoding="UTF-8"
		indent="yes" />

	<!--  Rootelement -->
	<xsl:template match="/">
		<html>
			<head>
				<title>Nebenkostenverwaltung</title>
				<link rel="SHORTCUT ICON" href="nkv/images/favicon.ico" />
			</head>
			<body bgcolor="#dcdcdc" link="#db7093" vlink="#db7093" alink="#db7093">
				<table border="0" cellspacing="2" cellpadding="2" align="center"
					width="100%">
					<tr>
						<td>
							<table align="center" bgcolor="#000000" border="0"
								cellspacing="2" cellpadding="2" width="50%">
								<tr>
									<td width="100%" heigth="100%" align="center" bgcolor="#0086b2">
										<table width="100%" heigth="100%" align="center"
											bgcolor="#dcdcdc">
											<tr>
												<td align="center">
													<font face="Herculanum" color="#0086b2">
														<h1>Nebenkostenverwaltung</h1>
													</font>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table bgcolor="#000000" border="0" cellspacing="2"
								cellpadding="2" align="left" width="100%">
								<tr>
									<td width="50%" align="left" bgcolor="#0086b2">
										<font face="arial,helvetica,sanserif" color="#ffffff">
											<i>Nebenkostenverwaltung</i>
										</font>
									</td>
									<td width="50%" align="right" bgcolor="#0086b2">
										<font face="arial,helvetica,sanserif" color="#ffffff">
											<a href=".." target="_self">zurück</a>
										</font>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<table border="0" cellspacing="2" cellpadding="2" align="left"
								width="100%">
								<tr>
									<td width="30%" valign="top">
										<table bgcolor="#000000" border="0" cellspacing="2"
											cellpadding="2" align="left" width="100%">
											<tr>
												<td bgcolor="#0086b2" width="100%" align="left">
													<font size="+1" face="arial,helvetica,sanserif" color="#ffffff">
														Übersicht
													</font>
												</td>
											</tr>
											<tr>
												<td width="100%" bgcolor="#ffffff" align="left">
													<table bgcolor="#ffffff" border="0" cellspacing="0"
														cellpadding="2" width="100%" align="center">
														Auf dieser Seite werden
														sämtliche Informationen über die
														gespeicherten Gasverbrauchswerte angezeigt.
														<br />
														Die enstandenen Kosten werden mi Hilfe der
														Verbrauchswerte, dem Grundpreis und dem Preis pro Einheit
														berechnet.

													</table>
												</td>
											</tr>
										</table>
									</td>
									<td width="70%" valign="top">
										<table bgcolor="#000000" border="0" cellspacing="2"
											cellpadding="2" align="left" width="100%">
											<tr>
												<td bgcolor="#0086b2" width="100%" align="left">
													<font size="+1" face="arial,helvetica,sanserif" color="#ffffff">
														Auswertung: Gas
													</font>
												</td>
											</tr>
											<tr>
												<td width="100%" bgcolor="#ffffff" align="left">
													<table bgcolor="#ffffff" border="0" cellspacing="0"
														cellpadding="2" width="100%" align="center">
														<xsl:apply-templates select="data" />
													</table>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td>
							<p align="center">
								<font size="-1">
									Copyright &#169; 1999-2007
									<a href="http://www.apache.org/">The Apache Software Foundation</a>
									.
									<br />
									Copyright &#169; 2010
									<a href="http://www.hs-bremen.de/">Hochschule Bremen</a>
									.
									<br />
									All rights reserved.
								</font>
							</p>
						</td>
					</tr>
				</table>
			</body>
		</html>
	</xsl:template>

	<!-- Auswertung -->
	<xsl:template match="data">
		<table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2"
			align="center">
			<tr>
				<td bgcolor="#0086b2" align="center">
					Art
					</td>
				<td bgcolor="#0086b2" align="center">
					Ablesedatum
					</td>
				<td bgcolor="#0086b2" align="center">
					Verbrauchswert
					</td>
				<td bgcolor="#0086b2" align="center">
					Grundpreis
					</td>
				<td bgcolor="#0086b2" align="center">
					Preis pro Einheit
					</td>
				<td bgcolor="#0086b2" align="center">
					Kosten
					</td>
			</tr>
			<xsl:for-each select="input">
				<xsl:sort select="@date" />
				<xsl:sort select="@type" />
				<xsl:if test="@type='Gas'">
					<tr>
						<td bgcolor="#FFFFFF" align="left">
							<xsl:value-of select="@type" />
						</td>
						<td bgcolor="#FFFFFF" align="right">
							<xsl:value-of select="@date" />
						</td>
						<td bgcolor="#FFFFFF" align="right">
							<xsl:value-of select='format-number(@value, "###.00")' />
							m
							<sup>3</sup>
						</td>
						<td bgcolor="#FFFFFF" align="right">
							<xsl:value-of select='format-number(@base_price, "###.00")' />
							€
						</td>
						<td bgcolor="#FFFFFF" align="right">
							<xsl:value-of select='format-number(@unit_price, "##0.0000")' />
							€
						</td>
						<td bgcolor="#FFFFFF" align="right">
							<xsl:value-of
								select='format-number(@base_price + @value * @unit_price * 9.6722, "###.00")' />
							€
						</td>
					</tr>
				</xsl:if>
			</xsl:for-each>
		</table>
	</xsl:template>
</xsl:stylesheet>
